package com.jmxcfc.blfsc.common.sms.enums;

/**
 * 短信、语音的发送状态枚举类(业务状态)
 * @author pbs
 */
public enum SendStatusEnum {
    //终态:发送成功
    SUCCESS("SUCCESS","成功"),
    //终态:发送失败
    FAILURE("FAILURE","失败");

    /**
     * 状态
     */
    private String status;

    /**
     * 描述
     */
    private String desc;


    SendStatusEnum(String status, String desc) {
        this.status = status;
        this.desc = desc;
    }

    public String status() {
        return this.status;
    }

    public String desc() {
        return this.desc;
    }


    /**
     * 根据值  获取 枚举
     * @param status
     * @return
     */
    public static SendStatusEnum getEnumByValue(String status) {
        SendStatusEnum[] instances = SendStatusEnum.values();
        for(SendStatusEnum instance : instances){
            if(instance.status().equals(status)){
                return instance;
            }
        }
        return null;
    }
}
